﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WebKpiPage.Data.TotalSearch
{
    public class TimeDescriptionHelper
    {
        public class BasicAttribute
        {
            public BasicAttribute()
            { }

            public BasicAttribute(object id, object name)
            {
                ID = id != null ? id.ToString() : "";
                Name = name != null ? name.ToString() : "";
            }

            public BasicAttribute(object id, object name, object description)
            {
                ID = id != null ? id.ToString() : "";
                Name = name != null ? name.ToString() : "";
                Description = description != null ? description.ToString() : "";
            }

            public override string ToString()
            {
                return name;
            }

            private string id = null;

            public string ID
            {
                get { return id; }
                set { id = value; }
            }

            private string name = null;

            public string Name
            {
                get { return name; }
                set { name = value; }
            }

            private string description = null;

            public string Description
            {
                get { return description; }
                set { description = value; }
            }

            private string setID = null;

            public string SetID
            {
                get
                {
                    return setID;
                }
                set
                {
                    setID = value;
                }
            }

            private Dictionary<string, string> param = new Dictionary<string, string>();

            public Dictionary<string, string> Param
            {
                get { return param; }
                set { param = value; }
            }
        }

        public class BasicSet
        {
            public BasicSet()
            { }

            public BasicSet(object id, object name)
            {
                ID = id != null ? id.ToString() : "";
                Name = name != null ? name.ToString() : "";
            }

            public BasicSet(object id, object name, object description)
            {
                ID = id != null ? id.ToString() : "";
                Name = name != null ? name.ToString() : "";
                Description = description != null ? description.ToString() : "";
            }

            public override string ToString()
            {
                return name;
            }

            private string id = null;

            public string ID
            {
                get { return id; }
                set { id = value; }
            }

            private string name = null;

            public string Name
            {
                get { return name; }
                set { name = value; }
            }

            private string dev_cat = null;

            public string DEV_CAT
            {
                get { return dev_cat; }
                set { dev_cat = value; }
            }

            private string description = null;

            public string Description
            {
                get { return description; }
                set { description = value; }
            }

            private Dictionary<string, string> param = new Dictionary<string, string>();

            public Dictionary<string, string> Param
            {
                get { return param; }
                set { param = value; }
            }
        }

        public class AttributeSet : BasicSet
        {
            public AttributeSet()
            { }

            public AttributeSet(object id, object name)
                : base(id, name)
            {
            }

            public AttributeSet(object id, object name, object description)
                : base(id, name, description)
            {
            }

            private string time_segment = null;

            public string TIME_SEGMENT
            {
                get { return time_segment; }
                set { time_segment = value; }
            }

            private string ne_cat = null;

            public string NE_CAT
            {
                get { return ne_cat; }
                set { ne_cat = value; }
            }

            private string capa_cat = null;

            public string CAPA_CAT
            {
                get { return capa_cat; }
                set { capa_cat = value; }
            }

            private string ref_cat = null;

            public string REF_CAT
            {
                get { return ref_cat; }
                set { ref_cat = value; }
            }

            public string Key
            {
                get { return capa_cat + ne_cat + time_segment + DEV_CAT; }
            }
        }

        public class ATTRIBUTE : BasicAttribute
        {
            public ATTRIBUTE()
            { }

            public ATTRIBUTE(object id, object name)
                : base(id, name)
            {
            }

            public ATTRIBUTE(object id, object name, object description)
                : base(id, name, description)
            {
            }

            private string table_col = null;

            public string TABLE_COL
            {
                get { return table_col; }
                set { table_col = value; }
            }

            private string display_type = null;

            public string DISPLAY_TYPE
            {
                get { return display_type; }
                set { display_type = value; }
            }
        }

        public class UserAttributeSet : BasicSet
        {
            public UserAttributeSet()
            { }

            public UserAttributeSet(object id, object name)
                : base(id, name)
            {
            }

            public UserAttributeSet(object id, object name, object description)
                : base(id, name, description)
            {
            }

            private string basic_ne_cat = null;

            public string BASIC_NE_CAT
            {
                get
                {
                    return basic_ne_cat;
                }
                set
                {
                    basic_ne_cat = value;
                }
            }

            private string userName = "";

            public string UserName
            {
                get
                {
                    return userName;
                }
                set
                {
                    userName = value;
                }
            }
        }

        public class UserAttribute : BasicAttribute
        {
            public UserAttribute()
            {
            }

            public UserAttribute(object id, object name)
                : base(id, name)
            {
            }

            public UserAttribute(object id, object name, object description)
                : base(id, name, description)
            {
            }

            private string formula = "";

            public string Formula
            {
                get
                {
                    return formula;
                }
                set
                {
                    formula = value;
                }
            }

            private string userName = "";

            public string UserName
            {
                get
                {
                    return userName;
                }
                set
                {
                    userName = value;
                }
            }

            private string userNameCN = "";

            public string UserNameCN
            {
                get
                {
                    return userNameCN;
                }
                set
                {
                    userNameCN = value;
                }
            }

            private string inResult = "";

            public string InResult
            {
                get
                {
                    return inResult;
                }
                set
                {
                    inResult = value;
                }
            }

            private string inResultMessage = "";

            public string InResultMessage
            {
                get
                {
                    return inResultMessage;
                }
                set
                {
                    inResultMessage = value;
                }
            }
        }

        public class CounterOBJTPYE : BasicSet
        {
            public CounterOBJTPYE()
            { }

            public CounterOBJTPYE(object id, object name)
                : base(id, name)
            {
            }

            public CounterOBJTPYE(object id, object name, object description)
                : base(id, name, description)
            {
            }

            private string time_segment = null;

            public string TIME_SEGMENT
            {
                get { return time_segment; }
                set { time_segment = value; }
            }

            private string ne_cat = null;

            public string NE_CAT
            {
                get { return ne_cat; }
                set { ne_cat = value; }
            }

            private string ref_cat = null;

            public string REF_CAT
            {
                get { return ref_cat; }
                set { ref_cat = value; }
            }

            private string basic_ne_cat = null;

            public string BASIC_NE_CAT
            {
                get { return basic_ne_cat; }
                set { basic_ne_cat = value; }
            }

            public string Key
            {
                get { return ne_cat + time_segment + DEV_CAT; }
            }
            //  [ID]
            //,[TABLE_NAME]
            //,[OBJTYPE]
            //,[BASIC_NE_CAT]
            //,[NE_CAT]
            //,[TIME_SEGMENT]
            //,[REF_CAT]
            //,[DEV_CAT]
        }

        public class Counter : BasicAttribute
        {
            public Counter()
            {
            }

            public Counter(object id, object name)
                : base(id, name)
            {
            }

            public Counter(object id, object name, object description)
                : base(id, name, description)
            {
            }

            private string objtype = null;

            public string OBJTYPE
            {
                get { return objtype; }
                set { objtype = value; }
            }
            //   [ID]
            //,[OBJTYPE_ID]
            //,[COUNTER_NAME]
            //,[DATA_TYPE]
        }
    }
}
